//
// Created by Jisam on 11/10/2024 20:10.
// Solution of  b
//#pragma GCC optimize(3)
#include <bits/stdc++.h>

#define int long long
using namespace std;
#define endl "\n"
#define PII pair<int,int>
#define VVI vector<vector<int>>
#define VI vector<int>
#define code_by_jisam cin.tie(nullptr)->sync_with_stdio(false);
int dx[] = {-1, 1, 0, 0, 1, 1, -1, -1,};
int dy[] = {0, 0, -1, 1, 1, -1, -1, 1,};
const double pi = acos(-1);
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;


void solution() {
    double a;
    cin >> a;  // 输入每个 a 的值

    // 计算结果
    double x = (a + sqrt(a * a + 4)) / 2;

    // 输出结果，保留9位小数
    cout << fixed << setprecision(9) << x << endl;
}

signed main() {
    code_by_jisam;
    int T = 1;
    cin >> T;
    while (T--) {
        solution();
    }
    return 0;
}